<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <router-link to="/register">注册</router-link>
    <router-link to="/login">登录</router-link>

    <router-view></router-view>
  </div>
  <script src="./vue.js"></script>
  <script src="./vue-router.js"></script>

  <script>
    const Register = {
      template: '<div>注册了11111111111111</div>'
    }
    const Login = {
      template: '<div>loginLOGIN11111111111111</div>'
    }

    const test = new VueRouter({
      routes: [
        { path: '/', redirect: '/login' },
        { path: '/register', component: Register },
        { path: '/login', component: Login }
      ]
    })

    new Vue({
      el: '#app',
      router: test
    })
  </script>
</body>
</html>